﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ThoiTrang.Business;
using ThoiTrang.Entities; 

public partial class Admin_UserControls_AdminMenuLeft : System.Web.UI.UserControl
{
    public string ckid = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            if (SessionManager.IsLogged)
            {
                a_User au = a_UserService.Geta_UserBySSID(SessionManager.GetCookie());
                if (au != null)
                {
                    this.Literal1.Text = au.UserTypeID.ToString();
                    this.Literal2.Text = au.IsAccessFeatured.ToString();
                }
                this.lblMemory.Text = SessionManager.GetCookie();
            }
        }
        ckid = this.lblMemory.Text;
    }

    public string GetVisible(int i)
    {
        if (int.Parse(this.Literal1.Text) == 2)
        {
            if (i <= 8 && i >= 6)
            {
                return "block";
            }
            if (this.Literal2.Text == "True")
            {
                if (i == 25 || i == 26 || i == 9)
                {
                    return "block";
                }
            }
        }
        else if (int.Parse(this.Literal1.Text) == 1)
        {
            return "block";
        }
        else if (int.Parse(this.Literal1.Text) == 3)
        {
            if(i==6 || i==7)
            {
                return "block";
            }
        }
        else if (int.Parse(this.Literal1.Text) == 4)
        {
            if (i == 6 || i == 7)
            {
                return "block";
            }
        }
        else
        {
            return "none";
        }
        return "none";
    }
}
